import com.google.appengine.api.datastore.*
import groovy.json.*

def id =// "izmir018"
		params.get("reportID")
boolean iwread = params.get("iwread").toBoolean()
int iwvalid = params.get("iwvalid").toInteger()

//System.out.println("update id: $id iwread: $iwread ival: $iwvalid")

def key = ['Report', id] as Key

def e = key.get();
//System.out.println("Report title is $e.reportTitle  read is $e.reportRead")

//return
//System.out.println("Before: valid is $e.validationStatus  read is $e.reportRead")

if (iwread!=null)
	e.reportRead=iwread

if(iwvalid!=null)
	e.validationStatus=iwvalid

e.save()

//System.out.println("After valid is $e.validationStatus  read is $e.reportRead")
//System.out.println "updated datastore "


